package com.plian.system.wrapper.glc;

import com.plian.system.dto.glc.GlcTaskIndicatorsRqDTO;
import com.plian.system.entity.glc.GlcTaskIndicatorsRq;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.glc.GlcTaskIndicatorsRqVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.SPRING;
import static com.plian.system.wrapper.util.WrapperConstant.USER_ID_TO_NAME;

@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface GlcTaskIndicatorsRqWrapper extends BaseWrapper<GlcTaskIndicatorsRq, GlcTaskIndicatorsRqDTO, GlcTaskIndicatorsRqVO> {

    /**
     * Entity转VO
     *
     * @param entity /
     * @return /
     */
    @Override
    @Mappings(value = {
            @Mapping(source = "createUser", target = "createUserName", qualifiedByName = USER_ID_TO_NAME),
            @Mapping(source = "updateUser", target = "updateUserName", qualifiedByName = USER_ID_TO_NAME)
    })
    GlcTaskIndicatorsRqVO entityToVO(GlcTaskIndicatorsRq entity);
}
